package com.htpro.controller;

import com.htpro.pojo.Plan;
import com.htpro.service.PlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class PlanController {
    @Autowired
    private PlanService ps;
@GetMapping("/cinemaByFid/{fid}")
    public List<Plan> cinemaByFilm(@PathVariable("fid") Integer id){
    List<Plan> list = ps.getCinemaByFname(id);
    return list;
}
    @GetMapping("/cinemaByFilm")
    public List<Plan> cinema(){
        List<Plan> list = ps.getAllCinema();
        return list;
    }
    @GetMapping("/cinemaByFilm/{fid}")
    public List<Plan> cinemaByfid(@PathVariable("fid") Integer id){
        List<Plan> list = ps.getCinemaByFname(id);
        return list;
    }
    @GetMapping("/getEveryCinema")
    public List<Plan> getEveryCinema(){
    List<Plan> list = ps.getEveryCinema();
    return list;
    }
    @GetMapping("/cinemaByYanchu/{cid}")
    public List<Plan> cinemaByYanchu(@PathVariable("cid") Integer id){
        List<Plan> list = ps.getCinemaByYingyuan(id);
        return list;
    }
}
